package com.purong.purong.bean;

import android.content.Context;

import com.kycq.library.basis.gadget.FileSaveHandler;
import com.purong.purong.util.CommonUtil;

import java.io.File;
import java.io.Serializable;

/**
 * Created by zwj on 2016/7/25.
 */
public class LoginBean extends BaseBean implements Serializable{
    private String user_id;
    private String user_type;
    private String nick;
    private String phone;
    private String pwd;
    private String os;
    private String invite_user_id;
    private String agency_level_id;
    private String credit_level_id;
    private String real;
    private String identity;
    private String avatar;
    private String sex;
    private String age;
    private String birthday;
    private String birth_address;
    private String domicile_address;
    private String work_address;
    private String user_status;
    private String is_real;//1未实名2已实名
    private String is_pay_pwd;
    private String real_time;
    private String is_student;
    private String login_time;
    private String login_ip;
    private String reg_ip;
    private String reg_time;
    private String remark;

    public String getBirth_address() {
        return birth_address;
    }

    public void setBirth_address(String birth_address) {
        this.birth_address = birth_address;
    }

    public String getDomicile_address() {
        return domicile_address;
    }

    public void setDomicile_address(String domicile_address) {
        this.domicile_address = domicile_address;
    }

    public String getWork_address() {
        return work_address;
    }

    public void setWork_address(String work_address) {
        this.work_address = work_address;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getUser_type() {
        return user_type;
    }

    public void setUser_type(String user_type) {
        this.user_type = user_type;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getOs() {
        return os;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public String getInvite_user_id() {
        return invite_user_id;
    }

    public void setInvite_user_id(String invite_user_id) {
        this.invite_user_id = invite_user_id;
    }

    public String getAgency_level_id() {
        return agency_level_id;
    }

    public void setAgency_level_id(String agency_level_id) {
        this.agency_level_id = agency_level_id;
    }

    public String getCredit_level_id() {
        return credit_level_id;
    }

    public void setCredit_level_id(String credit_level_id) {
        this.credit_level_id = credit_level_id;
    }

    public String getReal() {
        return real;
    }

    public void setReal(String real) {
        this.real = real;
    }

    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getUser_status() {
        return user_status;
    }

    public void setUser_status(String user_status) {
        this.user_status = user_status;
    }

    public String getIs_real() {
        return is_real;
    }

    public void setIs_real(String is_real) {
        this.is_real = is_real;
    }

    public String getIs_pay_pwd() {
        return is_pay_pwd;
    }

    public void setIs_pay_pwd(String is_pay_pwd) {
        this.is_pay_pwd = is_pay_pwd;
    }

    public String getReal_time() {
        return real_time;
    }

    public void setReal_time(String real_time) {
        this.real_time = real_time;
    }

    public String getIs_student() {
        return is_student;
    }

    public void setIs_student(String is_student) {
        this.is_student = is_student;
    }

    public String getLogin_time() {
        return login_time;
    }

    public void setLogin_time(String login_time) {
        this.login_time = login_time;
    }

    public String getLogin_ip() {
        return login_ip;
    }

    public void setLogin_ip(String login_ip) {
        this.login_ip = login_ip;
    }

    public String getReg_ip() {
        return reg_ip;
    }

    public void setReg_ip(String reg_ip) {
        this.reg_ip = reg_ip;
    }

    public String getReg_time() {
        return reg_time;
    }

    public void setReg_time(String reg_time) {
        this.reg_time = reg_time;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void save(Context context) {
        File dir = new File(CommonUtil.getDiskFileDir(context));
//        if (dir == null || (!dir.exists() && !dir.mkdirs())) {
//            dir = context.getFilesDir();
//        }
        FileSaveHandler.saveObject(dir.getAbsolutePath() + "/data.bat", this);
    }
    public static LoginBean read(Context context) {
        File dir = new File(CommonUtil.getDiskFileDir(context));
        return (LoginBean) FileSaveHandler.readObject(dir.getAbsolutePath() + "/data.bat");
    }
    public static void remove(Context context) {
        File dir = new File(CommonUtil.getDiskFileDir(context));
        FileSaveHandler.removeObject(dir.getAbsolutePath() + "/data.bat");
    }

}
